<template>
  <transition name="message">
    <div class="message-wrapper" v-if="isShow">
      <div class="message-content">
        <i class="iconfont icon-success" v-if="type === 'success'"></i>
        <i class="iconfont icon-error" v-if="type === 'error'"></i>
        <span class="message-text">{{ text }}</span>
      </div>
    </div>
  </transition>
</template>

<script>
export default {
  name: 'message',
  props: {
    type: {
      type: String,
      default: 'success'
    },
    text: {
      type: String,
      default: ''
    },
    isShow: {
      type: Boolean,
      default: true
    }
  }
}
</script>
